#include "victory.h"
#include <QPainter>
#include "mypushbutton.h"
#include <QDebug>
#include <QTimer>

Victory::Victory(QWidget *parent) : QMainWindow(parent)
{
    this->setFixedSize(1200,800);

    this->setWindowIcon(QPixmap(":/pictures/title.png"));

    this->setWindowTitle("问题");

    MyPushButton * backBtn = new MyPushButton(":/pictures/backbutton.png");
    backBtn->setParent(this);
    backBtn->move(this->width()-backBtn->width(),this->height()-backBtn->height());

    connect(backBtn,&MyPushButton::clicked,[=](){
        backBtn->zoom1();
        backBtn->zoom2();

        QTimer::singleShot(500,this,[=](){
            emit this->vrb();
        });
    });
}

void Victory::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    QPixmap pix;
    pix.load(":/pictures/victory.png");
    painter.drawPixmap(0,0,this->width(),this->height(),pix);
}
